package com.atguigu.algorithm;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
public class Mkdir {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNextInt()){
            int n=scanner.nextInt();
            List<String> list=new ArrayList<>();
            String[] strings=new String[n];
            strings[0]= scanner.nextLine();;
            for(int i=0;i<n;i++){
                strings[i]=scanner.nextLine();
            }
            Arrays.sort(strings);
            for(int i=0;i<n;i++){
                String tmp1=strings[i];
                if(i!=n-1) {
                    String tmp2 = strings[i + 1];
                    if(tmp2.substring(0,tmp1.length()).equals(tmp1)){
                        i++;
                        continue;
                    }
                }
                list.add(strings[i]);
            }
            for(String s:list){
                System.out.println("mkdir -p "+s);
            }
        }
    }
}
